package org.testis.gui.mvc.model.testdesign;

import org.testis.gui.mvc.model.*;
import org.testis.gui.mvc.controller.testdesign.PreConditionCaseController;


/**
 *
 * @author Cahit Emir Erel
 */
public class PreConditionCaseModel extends AbstractModel
{

    private Boolean m_preConditionCaseVisibility = false;
    private Boolean m_critical = false;
    private Integer m_timeout = 0;
    private String m_name = "";
    private String m_description = "";


    public String getName()
    {
        return m_name;
    }


    public void setName(String name)
    {
        if (name == null) {
            name = "";
        }
        String oldName = m_name;
        m_name = name;
        firePropertyChange(PreConditionCaseController.CHANGE_NAME,
                           oldName,
                           name);
    }


    public String getDescription()
    {
        return m_description;
    }


    public void setDescription(String description)
    {
        if (description == null) {
            description = "";
        }
        String oldDescription = m_description;
        m_description = description;
        firePropertyChange(PreConditionCaseController.CHANGE_DESCRIPTION,
                           oldDescription,
                           description);
    }


    public Integer getTimeout()
    {
        return m_timeout;
    }


    public void setTimeout(Integer timeout)
    {
        if (timeout == null) {
            return;
        }
        Integer oldTimeout = m_timeout;
        m_timeout = timeout;
        firePropertyChange(PreConditionCaseController.CHANGE_TIMEOUT,
                           oldTimeout,
                           timeout);
    }


    public void setPreConditionCaseVisibility(Boolean preConditionCaseVisibility)
    {
        if (preConditionCaseVisibility == null) {
            return;
        }
        Boolean oldPreConditionCaseVisibility = m_preConditionCaseVisibility;
        m_preConditionCaseVisibility = preConditionCaseVisibility;
        firePropertyChange(PreConditionCaseController.SHOW_ADD_PRE_CONDITION_CASE,
                           oldPreConditionCaseVisibility,
                           preConditionCaseVisibility);
    }


    public Boolean getPreConditionCaseVisibility()
    {
        return m_preConditionCaseVisibility;
    }


    public Boolean getCritical()
    {
        return m_critical;
    }


    public void setCritical(Boolean critical)
    {
        if (critical == null) {
            return;
        }
        Boolean oldCritical = m_critical;
        m_critical = critical;
        firePropertyChange(PreConditionCaseController.CHANGE_CRITICAL,
                           oldCritical,
                           critical);
    }
}
